//
//  UIButton+Extension.swift
//  xinlangweibo
//
//  Created by 陈志强 on 15/11/17.
//  Copyright © 2015年 陈志强. All rights reserved.
//

import UIKit


extension UIButton{
    convenience init(title: String, backimage: String, color: UIColor?){
        self.init()
        setTitle(title, forState: .Normal)
        setBackgroundImage(UIImage(named: backimage), forState: .Normal)
        setBackgroundImage(UIImage(named: backimage + "_highlighted"), forState: .Highlighted)
       if color != nil {
           setTitleColor(color, forState: .Normal)
        }
    }
}